package com.kg.sdk;

import android.os.Parcel;
import android.os.Parcelable;

public class KPUserData implements Parcelable {
    public  String auth_code;
    public  String auth_key;
    public  String use_code;//登录唯一标识
    public  int game_id = -1;//游戏id
    public  int channel_id = -1;//渠道id

    public KPUserData(){

    }
    protected KPUserData(Parcel in) {
        auth_code = in.readString();
        auth_key = in.readString();
        use_code = in.readString();
        game_id = in.readInt();
        channel_id = in.readInt();
    }

    public static final Creator<KPUserData> CREATOR = new Creator<KPUserData>() {
        @Override
        public KPUserData createFromParcel(Parcel in) {
            return new KPUserData(in);
        }

        @Override
        public KPUserData[] newArray(int size) {
            return new KPUserData[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(auth_code);
        dest.writeString(auth_key);
        dest.writeString(use_code);
        dest.writeInt(game_id);
        dest.writeInt(channel_id);
    }

    @Override
    public String toString(){
        StringBuilder builder = new StringBuilder();
        String split = " ";
        builder.append("auth_code: ");
        builder.append(auth_code);
        builder.append(split);
        builder.append("auth_key: ");
        builder.append(auth_key);
        builder.append(split);
        builder.append("use_code: ");
        builder.append(use_code);
        builder.append(split);
        builder.append("game_id: ");
        builder.append(game_id);
        builder.append(split);
        builder.append("channel_id: ");
        builder.append(channel_id);
        return builder.toString();
    }

}
